package com.wwmz.state.pattern.gper;

/**
 * Created by wumz on 2020/9/22 17:48
 */
public class UnLoginState extends UserState {
    @Override
    public void favorite() {
        this.switch2login();
        super.context.getState().favorite();
    }

    @Override
    public void comment(String comment) {
        this.switch2login();
        super.context.getState().comment(comment);
    }

    private void switch2login(){
        System.out.println("跳转到登录页！");
        super.context.setState(this.context.STATE_LOGIN);
    }
}
